{% extends "page_base.html" %}

{% block content %}
<a style="display:scroll;position:fixed;bottom:5px;right:250px;" href="#">Back to Top</a>

{% ifnotequal availability 'none' %}
	<div class='choice'>
	{% ifequal availability 'lecture' %}<h4>Organized by Lecture</h4>{% endifequal %}
		
	{% ifequal availability 'book' %}<h4>Organized by Book</h4>{% endifequal %}
		
	{% ifequal availability 'both' %} 
		{% ifequal choice 'lecture' %}
	<h4>Organized by Lecture | <a href="/{{ course.id}}/book/">Organized by Book</a></h4>
		{% else %} <h4><a href="/{{course.id}}/lecture/">Organized by Lecture</a> | Organized by Book</h4>
		{% endifequal %}
	{% endifequal %}


	<div class="toc">
	{% ifequal choice 'lecture' %} {% include "courseTOCLecture.html" %}
	{% else %} 
	<div id="booklist">
		<ul>
		{% for book in books %}
			<li><a href="#{{ book.title|title|safe }}"> {{ book.title|title|safe }}</a></li>
		{% endfor %}
		</ul>
	</div>
	<br>
	<div id="bookTOC">
		{% for book in books %}
			<div id ="{{ book.title|title|safe }}">
			{% include "bookTOC.html" %}
			</div>
		{% endfor %}
	</div>
	{% endifequal %}
	</div>
	
{% endifnotequal %}
{% endblock %}

